
#include<stdio.h>

int main()
{
    int year, month,judge;
    scanf("%d %d",&year,&month);

    if(month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12)
    {
        judge = 1;
    }
    else if(month == 2)
    {
        if((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
        {
            judge = 2;
        }
        else
        {
            judge = 3;
        }
    }
    else if(month == 4 || month == 6 || month == 9 || month == 11)
    {
        judge = 4;
    }
    else
    {
        judge = 0;
    }

    switch(judge)
    {
        case 1:
        printf("31天");
        break;
        case 2:
        printf("29天");
        break;
        case 3:
        printf("28天");
        break;
        case 4:
        printf("30天");
        break;
        case 0:
        printf("输入月份不在合法范围内");
        break;
        default:
        break;
}

return 0;
}
